package com.itheima.test6;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * @Author:gy
 * @Date: 2025/09/03 16:12
 * @Description:
 */
public class Demo {
    public static void main(String[] args) throws UnknownHostException {
        InetAddress id = InetAddress.getByName("LAPTOP-0EDB9V8K");
        System.out.println(id);
        String hostName = id.getHostName();
        System.out.println(hostName);
        String hostAddress = id.getHostAddress();
        System.out.println(hostAddress);
    }
}
